package com.nanrui.mutualinductor.data;


import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;

/**
 * ct测试
 */
public class Packet_56_01
        extends DKPacket {
    private short mFlag;
    private short mGrade;
    private float mMiniLoad;
    private float mPhaseAngle;
    private float mRatedLoad;
    private float mRatedPrimary;
    private float mRatedSecondary;
    private int sBackup;
    private short sFlag;
    private short sGrade;
    private float[] sIErrors;
    private float[] sIRoundErrors;
    private float sMiniLoad;
    private float sPhaseAngle;
    private float[] sPhaseDisps;
    private float sPhaseError;
    private float[] sPhaseRoundDisps;
    private float sQuadratureError;
    private float sRatedLoad;
    private float sRatedPrimary;
    private float sRatedSecondary;
    private short sResult;
    private float sSecondaryR;
    private short sStatus;
    private float sWorkingVoltage;

    public Packet_56_01() {
        super((short) 3, (short) 86);
    }

    public short getmFlag() {
        return this.mFlag;
    }

    public short getmGrade() {
        return this.mGrade;
    }

    public float getmMiniLoad() {
        return this.mMiniLoad;
    }

    public float getmPhaseAngle() {
        return this.mPhaseAngle;
    }

    public float getmRatedLoad() {
        return this.mRatedLoad;
    }

    public float getmRatedPrimary() {
        return this.mRatedPrimary;
    }

    public float getmRatedSecondary() {
        return this.mRatedSecondary;
    }

    public short getsFlag() {
        return this.sFlag;
    }

    public short getsGrade() {
        return this.sGrade;
    }

    public float[] getsIErrors() {
        return this.sIErrors;
    }

    public float[] getsIRoundErrors() {
        return this.sIRoundErrors;
    }

    public float getsMiniLoad() {
        return this.sMiniLoad;
    }

    public float getsPhaseAngle() {
        return this.sPhaseAngle;
    }

    public float[] getsPhaseDisps() {
        return this.sPhaseDisps;
    }

    public float getsPhaseError() {
        return this.sPhaseError;
    }

    public float[] getsPhaseRoundDisps() {
        return this.sPhaseRoundDisps;
    }

    public float getsQuadratureError() {
        return this.sQuadratureError;
    }

    public float getsRatedLoad() {
        return this.sRatedLoad;
    }

    public float getsRatedPrimary() {
        return this.sRatedPrimary;
    }

    public float getsRatedSecondary() {
        return this.sRatedSecondary;
    }

    public short getsResult() {
        return this.sResult;
    }

    public float getsSecondaryR() {
        return this.sSecondaryR;
    }

    public short getsStatus() {
        return this.sStatus;
    }

    public float getsWorkingVoltage() {
        return this.sWorkingVoltage;
    }

    @Override
    byte[] packContent() {
        byte[] arrayOfByte = new byte[22];
        int i = 0 + 1;
        arrayOfByte[0] = ((byte) (byte) this.mFlag);
        int j = i + 1;
        arrayOfByte[i] = ((byte) (byte) this.mGrade);
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mRatedPrimary).array(), 0, arrayOfByte, j, 4);
        i = j + 4;
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mRatedSecondary).array(), 0, arrayOfByte, i, 4);
        i += 4;
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mRatedLoad).array(), 0, arrayOfByte, i, 4);
        i += 4;
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mMiniLoad).array(), 0, arrayOfByte, i, 4);
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mPhaseAngle).array(), 0, arrayOfByte, i + 4, 4);
        return arrayOfByte;
    }

    public Packet_56_01 setmFlag(short paramShort) {
        this.mFlag = ((short) paramShort);
        return this;
    }

    public Packet_56_01 setmGrade(short paramShort) {
        this.mGrade = ((short) paramShort);
        return this;
    }

    public Packet_56_01 setmMiniLoad(float paramFloat) {
        this.mMiniLoad = paramFloat;
        return this;
    }

    public Packet_56_01 setmPhaseAngle(float paramFloat) {
        this.mPhaseAngle = paramFloat;
        return this;
    }

    public Packet_56_01 setmRatedLoad(float paramFloat) {
        this.mRatedLoad = paramFloat;
        return this;
    }

    public Packet_56_01 setmRatedPrimary(float paramFloat) {
        this.mRatedPrimary = paramFloat;
        return this;
    }

    public Packet_56_01 setmRatedSecondary(float paramFloat) {
        this.mRatedSecondary = paramFloat;
        return this;
    }

    @Override
    void unpackContent(byte[] paramArrayOfByte) {
        int i = 0 + 1;
        this.sFlag = ((short) (short) (paramArrayOfByte[0] & 0xFF));
        int j = i + 1;
        this.sGrade = ((short) (short) (paramArrayOfByte[i] & 0xFF));
        int k = j + 1;
        this.sResult = ((short) (short) (paramArrayOfByte[j] & 0xFF));
        i = k + 1;
        this.sStatus = ((short) (short) (paramArrayOfByte[k] & 0xFF));
        j = i + 1;
        k = paramArrayOfByte[i];
        i = j + 1;
        this.sBackup = (k & 0xFF | paramArrayOfByte[j] << 8 & 0xFFFF);
        k = i + 4;
        this.sRatedPrimary = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, k)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = k + 4;
        this.sRatedSecondary = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, k, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        i = j + 4;
        this.sRatedLoad = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = i + 4;
        this.sMiniLoad = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        i = j + 4;
        this.sPhaseAngle = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = i + 4;
        this.sPhaseError = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        k = j + 4;
        this.sQuadratureError = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, k)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        i = k + 4;
        this.sWorkingVoltage = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, k, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = i + 4;
        this.sSecondaryR = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        this.sIErrors = new float[9];
        k = 0;
        i = 0;
        float[] arrayOfFloat;
        int m;
        while (i < this.sIErrors.length) {
            arrayOfFloat = this.sIErrors;
            m = j + 4;
            arrayOfFloat[i] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, m)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            i++;
            j = m;
        }
        this.sIRoundErrors = new float[9];
        i = 0;
        while (i < this.sIRoundErrors.length) {
            arrayOfFloat = this.sIRoundErrors;
            m = j + 4;
            arrayOfFloat[i] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, m)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            i++;
            j = m;
        }
        this.sPhaseDisps = new float[9];
        i = 0;
        while (i < this.sPhaseDisps.length) {
            arrayOfFloat = this.sPhaseDisps;
            m = j + 4;
            arrayOfFloat[i] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, m)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            i++;
            j = m;
        }
        this.sPhaseRoundDisps = new float[9];
        i = j;
        for (j = k; j < this.sPhaseRoundDisps.length; j++) {
            arrayOfFloat = this.sPhaseRoundDisps;
            k = i + 4;
            arrayOfFloat[j] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, k)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            i = k;
        }
    }
}

